<template>
  <div class="dashboard-container">
    <component :is="dashboardType"></component>
  </div>
</template>

<script>
  import operationDashboard from './operationer'
  import serviceproviderDashboard from './serviceprovider'
  import store from '../../store'

  export default {
    name: 'dashboard',
    components: {operationDashboard, serviceproviderDashboard},
    created() {
      this.initDashboard()
    },
    data() {
      return {
        dashboardType: ''
      }
    },
    methods: {
      initDashboard() {
        console.log(store.getters.platformType)
        if (store.getters.platformType == '1') {
          this.dashboardType = 'operationDashboard'
        } else {
          this.dashboardType = 'serviceproviderDashboard'
        }
      }
    }
  }

</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }
    &-text {
      font-size: 30px;
      line-height: 46px;
    }
  }
</style>
